[IA64] Fix MCA error handler problems
authorAlex Williamson <alex.williamson@hp.com>
Fri, 12 Oct 2007 21:02:06 +0000 (15:02 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Fri, 12 Oct 2007 21:02:06 +0000 (15:02 -0600)
commit00e89132c295ea790066d8e1cb1b87352cd8f142
tree1ee6ebec9fac542a53d81002e2203b5b4caea66a
parent6c20dd9c1d260a862682567ce5035f6f6a28d2bd
[IA64] Fix MCA error handler problems

Fixing MCA issues related to changes from kexec patch series...

[From "Kexec: Fix ia64_do_tlb_purge so that it works with XEN"]

> 2. Use the per_cpu variable to derive CURRENT_STACK_OFFSET rather
>    than reading it from a kernel register. See 1) for explanation
>    of why.

I added the same code in Reload DTR for stack part and also added a
code to avoid overlapping with kernel TR.

> 3. In the VHPT pruning code, don't use r25 as ia64_jump_to_sal,
>    which branches to ia64_do_tlb_purge expects r25 to be preserved.
>    There seems no reason not to use r2 as per the other purges
>    done in ia64_do_tlb_purge.  Furthermore use r16 and r18 instead
>    of r20 and r24 for consistency reasons.

The r25 kept the value of __va_ul(vcpu_vhpt_maddr(v)), and it was
referred to by the following lines.

468     // r25 = __va_ul(vcpu_vhpt_maddr(v));
469     dep r20=0,r25,0,IA64_GRANULE_SHIFT
470     movl r26=PAGE_KERNEL
471     ;;
472     mov r21=IA64_TR_VHPT
473     dep r22=0,r20,60,4              // physical address of

I defined GET_VA_VCPU_VHPT_MADDR() macro to re-calculate the value of
__va_ul(vcpu_vhpt_maddr(v)) in each part.
And I renamed the register names for same reasons.

Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
xen/arch/ia64/linux-xen/mca_asm.S